'use strict';

const conn = require('../../libs/Conn');

module.exports = async function (params) {

    let querySql = `SELECT
                        '全部' AS dataType,
                        'all' AS
                    value
                    
                    UNION
                        SELECT
                            df.department_name AS dataType,
                            ug.group_id AS
                        value
                    
                        FROM
                            department_file df
                        INNER JOIN user_group ug ON df.department_id = ug.department
                        AND ug.delete_sign = 1
                        WHERE
                            df.delete_sign = 1`;
    let rec = await conn(querySql);
    return {success: true, data: rec};

};